import 'package:flutter/material.dart';
import 'package:xindong/common/xindong_define.dart';
import 'package:xindong/common/xindong_sezhi.dart';
import 'package:xindong/res/assets_res.dart';
import 'package:xindong/utils/xindong_image_util.dart';

/// 首页背景视图
class XinDongHomeBackgroundView extends StatelessWidget {
  final Widget? child;

  const XinDongHomeBackgroundView({Key? key, this.child}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Stack(
      fit: StackFit.expand,
      children: [
        Container(
          alignment: Alignment.topCenter,
          color: DZColors.appBar,
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: <Widget>[
              SizedBox(width: screenWidth, child: ImageUtil.asset(AssetsRes.IMAGE_HOME_BG1, fit: BoxFit.fitWidth)),
              SizedBox(width: screenWidth, child: ImageUtil.asset(AssetsRes.IMAGE_HOME_BG2, fit: BoxFit.fitWidth)),
            ],
          ),
        ),
        Container(child: child),
      ],
    );
  }
}
